from django.conf.urls.defaults import *
from feeds import LatestEntries
feeds = {
    'news': LatestEntries,
    #'categories': LatestEntriesByCategory,
}

from content.admin import site
from views import *

from django.contrib import admin
import settings
admin.autodiscover()

urlpatterns = patterns('',
    (r'^$', home),
    (r'^admin/(.*)', site.root),
    (r'^biography/(?P<person_slug>[^/]+)/$', biography),
    (r'^posts/(?P<year>\d+)/(?P<month>\d+)/(?P<post_slug>[^/]+)/$', blog_post),
    (r'^archive/$', blog_archive),
    
    #RSS
    (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),
    
    # artist pages
    (r'^(?P<artist_slug>[^/]+)/$', artist_home),
    (r'^(?P<artist_slug>[^/]+)/discography/$', discography),
    (r'^(?P<artist_slug>[^/]+)/lyrics/$', lyrics_overview),
    (r'^(?P<artist_slug>[^/]+)/(?P<album_slug>[^/]+)/$', album_page),
    (r'^(?P<artist_slug>[^/]+)/(?P<album_slug>[^/]+)/(?P<song_slug>[^/]+)/text/$', song_text),
    (r'^(?P<artist_slug>[^/]+)/lyrics/(?P<song_slug>[^/]+)/$', lyrics_page),
)
if not settings.APACHE:
    urlpatterns += patterns('',
       (r'^site-media/(.*)$', 'django.views.static.serve', {'document_root':
                                                            settings.MEDIA_ROOT,
                                                            'show_indexes': True}),
       (r'^mp3s/(.*)$', 'django.views.static.serve', {'document_root':
                                                            settings.MP3_DIRECTORY,
                                                            'show_indexes': True}),
       (r'^scraps/(.*)$', 'django.views.static.serve', {'document_root':
                                                            settings.IMAGE_DIRECTORY,
                                                            'show_indexes': True}),
       # (r'^(cms|site|blog)-media/(.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT+'/\1-media'})
    )
